package com.supermarket.seefood51.api


import com.example.http.api.BaseApi
import com.example.http.listener.HttpOnNextListener
import com.supermarket.seefood51.BASE_URL
import com.supermarket.seefood51.entity.SeaFoodEntity
import com.supermarket.seefood51.entity.SeaFoodParentEntity
import com.supermarket.seefood51.service.HttpService
import com.trello.rxlifecycle.components.support.RxAppCompatActivity
import retrofit2.Retrofit
import rx.Observable

class ProductApi(rxAppCompatActivity: RxAppCompatActivity, private val worNumber: String,
                 listener: HttpOnNextListener<List<SeaFoodParentEntity>>) :
        BaseApi<SeaFoodParentEntity>(rxAppCompatActivity, listener, BASE_URL) {
    //提供请求所需字段的数据
    override fun getObservable(retrofit: Retrofit): Observable<*> {

        val service = retrofit.create<HttpService>(HttpService::class.java)
        return service.requestList(worNumber)//传数据到HttpService
    }


}